// ========================== 
// 描述：
// 作者：MING
// 创建时间：2022/02/26 17:57:49 
// 版本：1.0
// ========================== 
using UnityEngine.UI;

namespace UIFrame
{
    /// <summary>
    /// 单选按钮
    /// </summary>
    public class RadioBtnItem : ButtonItem
    {
        private Text text;
        private bool radio;
        public string Radio_True = "开启";
        public string Radio_False = "关闭";
        public bool Radio { get => radio; set => radio = value; }

        protected override void Start()
        {
            text = transform.GetChild(1).GetComponent<Text>();
            myAction += () =>
            {
                radio = !radio;
                text.text = radio ? Radio_True : Radio_False;
            };
            base.Start();
        }
    }
}
